var mongoose = require('mongoose');

var postSchema = new mongoose.Schema({
    creationDate: { type: Date, required: true, default: Date.now },
    title: { type: String, required: true },
    description: { type: String, required: true },
    startDate: { type: Date, required: true },
    endDate: { type: Date, required: true },
    bikeId: { type: Number },
    street: { type: String, required: true },
    postCode: { type: String, required: true },
    city: { type: String, required: true },
    region: { type: String, required: true },
    country: { type: String, required: true },
    user_id: { type: String }
});

var post = mongoose.model('post', postSchema);

module.exports = {
  Post: post
};